/**
 * Notes: 系统任务实体 
 * Date: 2023-05-20 09:15:00 
 * Ver : CCMiniCloud Framework 2.0.6 ALL RIGHTS RESERVED BY CCLINUX0730 (wechat)
 */

const BaseModel = require('./base_model.js');

class TaskModel extends BaseModel {

}

// 集合名
TaskModel.CL = BaseModel.C('task');

TaskModel.DB_STRUCTURE = {
    _pid: 'string|true',
    TASK_ID: 'string|true',
    TASK_NAME: 'string|true|comment=任务名称',
    TASK_TYPE: 'int|true|default=0|comment=任务类型：0=定时任务 1=一次性任务',
    TASK_STATUS: 'int|true|default=1|comment=状态：0=禁用 1=启用',
    TASK_LAST_RUN: 'int|true|default=0|comment=最后运行时间戳',
    TASK_NEXT_RUN: 'int|true|default=0|comment=下次运行时间戳',
    TASK_CRON: 'string|false|comment=定时表达式',
    TASK_FUNC: 'string|true|comment=执行的函数名',
    TASK_PARAMS: 'object|false|comment=传递的参数',
    TASK_DESC: 'string|false|comment=任务描述',
    
    TASK_ADD_TIME: 'int|true',
    TASK_EDIT_TIME: 'int|true',
    TASK_ADD_IP: 'string|false',
    TASK_EDIT_IP: 'string|false',
};

// 字段前缀
TaskModel.FIELD_PREFIX = "TASK_";

module.exports = TaskModel; 